package org.dingfugui.triple.common;

import java.util.logging.Level;

/**
 * Created by fugui.ding on 2015/6/9.
 */
public class LoggerByJdk implements Logger {

    java.util.logging.Logger logger;

    public LoggerByJdk(String name) {
        this.logger = java.util.logging.Logger.getLogger(name);
    }

    @Override
    public boolean isTraceEnabled() {
        return true;
    }

    @Override
    public void trace(String msg) {
        logger.log(Level.FINEST, msg);
    }

    @Override
    public void trace(String format, Object arg) {
        logger.log(Level.FINEST, format, arg);
    }


    @Override
    public void trace(String format, Object... arguments) {
        logger.log(Level.FINEST, format, arguments);
    }

    @Override
    public void trace(String msg, Throwable t) {
        logger.log(Level.FINEST, msg, t);
    }

    @Override
    public boolean isDebugEnabled() {
        return true;
    }

    @Override
    public void debug(String msg) {
        logger.log(Level.FINE, msg);
    }

    @Override
    public void debug(String format, Object arg) {
        logger.log(Level.FINE, format, arg);
    }


    @Override
    public void debug(String format, Object... arguments) {
        logger.log(Level.FINE, format, arguments);
    }

    @Override
    public void debug(String msg, Throwable t) {
        logger.log(Level.FINE, msg, t);
    }

    @Override
    public boolean isInfoEnabled() {
        return true;
    }

    @Override
    public void info(String msg) {
        logger.log(Level.INFO, msg);
    }

    @Override
    public void info(String format, Object arg) {
        logger.log(Level.INFO, format, arg);
    }


    @Override
    public void info(String format, Object... arguments) {
        logger.log(Level.INFO, format, arguments);
    }

    @Override
    public void info(String msg, Throwable t) {
        logger.log(Level.INFO, msg, t);
    }

    @Override
    public boolean isWarnEnabled() {
        return true;
    }

    @Override
    public void warn(String msg) {
        logger.log(Level.WARNING, msg);
    }

    @Override
    public void warn(String format, Object arg) {
        logger.log(Level.WARNING, format, arg);
    }


    @Override
    public void warn(String format, Object... arguments) {
        logger.log(Level.WARNING, format, arguments);
    }

    @Override
    public void warn(String msg, Throwable t) {
        logger.log(Level.WARNING, msg, t);
    }

    @Override
    public boolean isErrorEnabled() {
        return true;
    }

    @Override
    public void error(String msg) {
        logger.log(Level.SEVERE, msg);
    }

    @Override
    public void error(String format, Object arg) {
        logger.log(Level.SEVERE, format, arg);
    }

    @Override
    public void error(String format, Object... arguments) {
        logger.log(Level.SEVERE, format, arguments);
    }

    @Override
    public void error(String msg, Throwable t) {
        logger.log(Level.SEVERE, msg, t);
    }
}
